//
//  UIFont+Ext.swift
//  ttjx
//
//  Created by 文 on 2021/7/28.
//  Copyright © 2021 ttjx. All rights reserved.
//

import Foundation
import UIKit


extension UIFont {
    //自定义字体  PangMenZhengDao
    public static func pmzd_font(_ font : CGFloat) -> UIFont {
        
        return UIFont.init(name: "PangMenZhengDao", size: font) ?? UIFont.systemFont(ofSize: font)
    }
    
    public static func mc_boldFont(_ font : CGFloat) -> UIFont {
        return UIFont.boldSystemFont(ofSize: font)
    }
    @objc func DDInFontMedium(fontSize:CGFloat) -> UIFont {
        if let customFont = UIFont(name: "D-DIN-PRO-Medium", size: fontSize) {
            return customFont
        } else {
            print("Custom font not found")
        }
        return .systemFont(ofSize: fontSize, weight: .medium)
    }
    func DDInFontSemiBold(fontSize:CGFloat) -> UIFont {
        if let customFont = UIFont(name: "D-DIN-PRO-SemiBold", size: fontSize) {
            return customFont
        } else {
            print("Custom font not found")
        }
        return .systemFont(ofSize: fontSize, weight: .semibold)
    }
    func DDInFontBold(fontSize:CGFloat) -> UIFont {
        if let customFont = UIFont(name: "D-DIN-PRO-Bold", size: fontSize) {
            return customFont
        } else {
            print("Custom font not found")
        }
        return .systemFont(ofSize: fontSize, weight: .bold)
    }
    
    func DDInFontExtraBold(fontSize:CGFloat) -> UIFont {
        if let customFont = UIFont(name: "D-DIN-PRO-ExtraBold", size: fontSize) {
            return customFont
        } else {
            print("Custom font not found")
        }
        return .systemFont(ofSize: fontSize, weight: .bold)
    }
    func DDInFontHeavy(fontSize:CGFloat) -> UIFont {
        if let customFont = UIFont(name: "D-DIN-PRO-Heavy", size: fontSize) {
            return customFont
        } else {
            print("Custom font not found")
        }
        return .systemFont(ofSize: fontSize, weight: .heavy)
    }
    func DDInFontRegular(fontSize:CGFloat) -> UIFont {
        if let customFont = UIFont(name: "D-DIN-PRO-Regular", size: fontSize) {
            return customFont
        } else {
            print("Custom font not found")
        }
        return .systemFont(ofSize: fontSize, weight: .regular)
    }
}
